/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import mx.its.dsw2.zapateriaLes.bl.UsuariosBlLocal;
import mx.its.dsw2.zapateriaLes.modelo.Usuarios;

/**
 *
 * @author lesly
 */
@ManagedBean
@SessionScoped
public class LoginBean implements Serializable{
    @EJB
    private UsuariosBlLocal usuariosBl;
     private String user = "";
    private String pass = "";
    private Usuarios usuario;
    /**
     * Creates a new instance of LoginBean
     */
    public LoginBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
     public String acceso() {
        String page = "";
        for (Usuarios usu : usuariosBl.obtenerUsuarios()) {
            if (user.equals(usu.getNombre()) && pass.equals(usu.getContrasena())) {
                ///  System.out.println("entrarrrrrr");
                page = "MenuPrincipal";
             // System.out.println("waaaa");
            }
        }
        return page;
    }   
}